#pragma once
#include "Interaction/InteractableQGraphicsItem.h"

namespace QtTutorial4
{
	class EnemyMissile : public QGraphicsItem
	{
	public:
		EnemyMissile(QGraphicsItem *parent = 0);
		~EnemyMissile();
		void initialize(QString inAppDirectory);

	public:
		QRectF boundingRect() const;
		const bool isInside(QPointF inPos) const;
		void update(float inFrameTime);
		void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);

	public:
		void setSize(QSizeF inSize) { mSize = inSize; }
		float getRadius() { return mSize.width()/2.0f; }

		const QVector2D& targetPosition() const { return mTargetPosition; }
		void setTargetPosition(QVector2D inTargetPosition) { mTargetPosition = inTargetPosition; }
		
		const bool exploded() const { return mExploded; }
		const bool hitTarget() const { return mHitTarget; }
		void setExploded(bool inExploded) { mExploded = inExploded; }
		
	private:
		QString mApplicationDirectory;
		float mTime;
		QVector2D mTargetPosition;
		QImage mImage;
		QSizeF mSize;
		bool mExploded;
		bool mHitTarget;
	};
}
